import junit.framework.Assert;

import org.junit.Test;

import static de.karlNet.condition.conditions.equal.EqualAnd.*;
import static de.karlNet.condition.conditions.equal.NotEqualAnd.*;

public class ComplexExpressions {

	@Test
	public void stringTest() {
		/**
		 * Executes if when String contains a,b,c,d BUT not e
		 */
		String a = "a";
		String b = "b";
		String c = "c";
		String d = "d";
		String e = "e";
		boolean met = equalAnd(a, b, c, d, (!e.equals("f"))).meets("a", "b",
				"c", "d", true);
		Assert.assertTrue(met);
	}

	@Test
	public void stringTestNested() {
		/**
		 * Executes if when String contains a,b,c,d BUT e != f and f!=e
		 */
		String a = "a";
		String b = "b";
		String c = "c";
		String d = "d";
		String e = "e";
		String f = "f";
		boolean met = equalAnd(a, b, c, d, notEqualAnd(e,f).meets("f","e")).meets("a", "b",
				"c", "d", true);
		Assert.assertTrue(met);
	}

	@Test
	public void combinedWithStandard() {
		int a = 5;
		int b = 3;
		int c = 1;

		Assert.assertTrue(equalAnd(a > 4, b < 4, c >= 0)
				.meets(true, true, true));
	}

	@Test
	public void combinedWithStandardMixed() {
		int a = 5;
		int b = 3;
		int c = 1;

		String f = "a";

		Assert.assertTrue(equalAnd(a > 4, b < 4, c >= 0, f).meets(true, true,
				true, "a"));
	}
}
